<template>
  <div :style="styleImgName" @click="handleClick">
    <h2>自定义组件</h2>
    <h3>我是参数:{{ option.data }}</h3>
  </div>
</template>
<script>
export default {
  props: {
    option: Object,
    component: Object,
  },
  computed: {
    styleImgName() {
      return Object.assign({
        fontSize: (this.option.fontSize || 30) + "px",
        color: this.option.color || "#fff",
      });
    },
  },
  methods: {
    handleClick() {
      this.clickFormatter &&
        this.clickFormatter(
          {
            data: this.option.data,
          },
          this.getItemRefs()
        );
    },
  },
};
</script>